<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    import="java.util.*,com.beans.*,com.DAO.*;"  pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Category</title>

</head>
<body>


<div class = "categorytitle">Add Category</div>
<div class = "categorycontent">

<center>
<form  action="AddCategoryForm.do" method="post">

<div class = "titletext">Category:</div>
<input type="text" name="name"/><br>
<div class = "titletext">Allow Comments:</div>
<input type="radio" name="allowComment" value="T"/> Yes
<input type="radio" name="allowComment" value="F"/> No
<br>
<input id = "btnsubmit" type="image" src = "image/60.jpg" name="insert" />
</form>
</center>
</div>
<%int id=0; 
%>

<div class = "categorytitle">Update Category</div>
<div class = "categorycontent">
<center>
<table cellspacing="0">
<tr>

<th>Category</th>
<th>Allow Comments</th>
<th colspan="3"></th>

</tr>


<%ArrayList<CategoryForm> clist=new ArrayList<CategoryForm>();

%>
<%CategoryDAO categoryDao=new CategoryDAO(); %>
<%
 	clist=categoryDao.get();
	for(CategoryForm categoryForm:clist)
	{
		id=categoryForm.getCategoryId();
		
		
%>

<tr>
<td>
<a href="UpdateCategory-1.jsp?id=<%=id%>"><%=categoryForm.getName()%></a>

</td>
<td>
<% if (categoryForm.getAllowComment().equals("T")) {%>
Yes
<% } else { %>
No
<%} %>
</td>


<td><a href="DeleteCategoryForm.do?id=<%=id%>">
	<img alt = "delete" src = "image/31.png" height="25" width="20" align="top">
</a></td>

</tr>

<%} %>

</table>
</center>
</div>
</body>
</html>